package com.xiaojf.demo.web.controller;

import com.xiaojf.demo.web.vm.User;
import com.xiaojf.xlog.annotation.AccessLogAnnotation;
import com.xiaojf.xlog.cons.OperateType;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * demo controller
 *
 * @author Ade.Xiao 2021/3/11 9:57
 */
@RestController
@RequestMapping("/")
public class DemoController {
    /**
     * 测试demo
     *
     * @param user
     * @return {@link Object}
     * @throws
     * @author Ade.Xiao 2021-03-11 17:59:09
     */
    @RequestMapping("/demo")
    @AccessLogAnnotation(
            operateType = OperateType.QUERY,
            success = "'success by' + #user.username ",
            fail = "'success by' + #user.username ")
    public Object demo(User user) throws Exception {
        return System.currentTimeMillis();
    }
}
